home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 70 / docs / appendix.1 next >
Text File  |  1987-12-25  |  88KB  |  3,279 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. O✓O✓O✓Ob✓b✓b✓bj✓j✓j✓je✓e✓e✓ec✓c✓c✓ct✓t✓t✓t
  8.  
  9.      The class O✓O✓O✓Ob✓b✓b✓bj✓j✓j✓je✓e✓e✓ec✓c✓c✓ct✓t✓t✓t is a superclass of all classes in  the
  10. system,  and  is  used  to  provide a consistent basic func-
  11. tionality and  default  behavior.   Many  methods  in  class
  12. O✓O✓O✓Ob✓b✓b✓bj✓j✓j✓je✓e✓e✓ec✓c✓c✓ct✓t✓t✓t are overridden in subclasses.
  13.  
  14. _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  15.  
  16.   ==           Return true if receiver and argument are  the
  17.                same object, false otherwise.
  18.  
  19.   ~~           Inverse of ==.
  20.  
  21.   asString     Return  a  string   representation   of   the
  22.                receiver,  by  default  this  is  the same as
  23.                _✓p_✓r_✓i_✓n_✓t_✓S_✓t_✓r_✓i_✓n_✓g, although one  or  the  other  is
  24.                redefined in many subclasses.
  25.  
  26.   asSymbol     Return a symbol representing the receiver.
  27.  
  28.   class        Return object representing the class  of  the
  29.                receiver.
  30.  
  31.   copy         Return shallowCopy of receiver.   Many  subc-
  32.                lasses redefine shallowCopy.
  33.  
  34.   deepCopy     Return the receiver.  This  method  is  rede-
  35.                fined in many subclasses.
  36.  
  37. _✓d do:          The argument must be a  one  argument  block.
  38.                Execute  the  block  on  every element of the
  39.                receiver   collection.    Elements   in   the
  40.                receiver  collection  are  listed using _✓f_✓i_✓r_✓s_✓t
  41.                and _✓n_✓e_✓x_✓t (below), so the default behavior  is
  42.                merely   to   execute  the  block  using  the
  43.                receiver as argument.
  44.  
  45.   error:       Argument must be a  String.   Print  argument
  46.                string as error message.  Return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l.
  47.  
  48. _✓n first        Return first item in sequence,  which  is  by
  49.                default   simply  the  receiver.   See  _✓n_✓e_✓x_✓t,
  50.                below.
  51.  
  52.   isKindOf:    Argument must be a  C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s.   Return  true  if
  53.                class of receiver, or any superclass thereof,
  54.                is the same as argument.
  55.  
  56.   isMemberOf:  Argument must be a  C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s.   Return  true  if
  57.                receiver is instance of argument class.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.   class O✓O✓O✓Ob✓b✓b✓bj✓j✓j✓je✓e✓e✓ec✓c✓c✓ct✓t✓t✓t (continued)
  71.  
  72.  
  73.     isNil        Test whether receiver is object n✓n✓n✓ni✓i✓i✓il✓l✓l✓l.
  74.  
  75.   _✓n next         Return next item in  sequence,  which  is  by
  76.                  default  n✓n✓n✓ni✓i✓i✓il✓l✓l✓l.   This  message is redefined in
  77.                  classes which represent  sequences,  such  as
  78.                  A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y or D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓y.
  79.  
  80.     notNil       Test if receiver is not object n✓n✓n✓ni✓i✓i✓il✓l✓l✓l.
  81.  
  82.     print        Display print image of receiver on the  stan-
  83.                  dard output.
  84.  
  85.     printString  Return a string representation  of  receiver.
  86.                  Objects  which  do  not redefine printString,
  87.                  and which therefore do not have  a  printable
  88.                  representation,  return their class name as a
  89.                  string.
  90.  
  91.     respondsTo:  Argument must be a symbol.   Return  true  if
  92.                  receiver  will  respond to the indicated mes-
  93.                  sage.
  94.  
  95.     shallowCopy  Return the receiver.  This  method  is  rede-
  96.                  fined in many subclasses.
  97.  
  98.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  99.  
  100.                                           Printed result
  101.  
  102.   7 ~~ 7.0                                True
  103.   7 asSymbol                              #7
  104.   7 class                                 Integer
  105.   7 copy                                  7
  106.   7 isKindOf: Number                      True
  107.   7 isMemberOf: Number                    False
  108.   7 isNil                                 False
  109.   7 respondsTo: #+                        True
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.   Object
  140.     U✓U✓U✓Un✓n✓n✓nd✓d✓d✓de✓e✓e✓ef✓f✓f✓fi✓i✓i✓in✓n✓n✓ne✓e✓e✓ed✓d✓d✓dO✓O✓O✓Ob✓b✓b✓bj✓j✓j✓je✓e✓e✓ec✓c✓c✓ct✓t✓t✓t
  141.  
  142.        The pseudo variable n✓n✓n✓ni✓i✓i✓il✓l✓l✓l is  an  instance  (usually  the
  143.   only instance) of the class U✓U✓U✓Un✓n✓n✓nd✓d✓d✓de✓e✓e✓ef✓f✓f✓fi✓i✓i✓in✓n✓n✓ne✓e✓e✓ed✓d✓d✓dO✓O✓O✓Ob✓b✓b✓bj✓j✓j✓je✓e✓e✓ec✓c✓c✓ct✓t✓t✓t.  n✓n✓n✓ni✓i✓i✓il✓l✓l✓l is used to
  144.   represent undefined values, and is also  typically  returned
  145.   in  error  situations.   n✓n✓n✓ni✓i✓i✓il✓l✓l✓l is also used as a terminator in
  146.   sequences, as for example in response to  the  message  _✓n_✓e_✓x_✓t
  147.   when there are no further elements in a sequence.
  148.  
  149.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  150.  
  151.   _✓r isNil        Overrides method  found  in  Object.   Return
  152.                  true.
  153.  
  154.   _✓r notNil       Overrides method  found  in  Object.   Return
  155.                  false.
  156.  
  157.   _✓r printString  Return 'nil'.
  158.  
  159.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  160.  
  161.                                           Printed result
  162.  
  163.   nil isNil                               True
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.   Object
  206.     S✓S✓S✓Sy✓y✓y✓ym✓m✓m✓mb✓b✓b✓bo✓o✓o✓ol✓l✓l✓l
  207.  
  208.        Instances of the class S✓S✓S✓Sy✓y✓y✓ym✓m✓m✓mb✓b✓b✓bo✓o✓o✓ol✓l✓l✓l  are  created  either  by
  209.   their literal representation, which is a pound sign followed
  210.   by a string of nonspace characters (for example #aSymbol  ),
  211.   or  by the message _✓a_✓s_✓S_✓y_✓m_✓b_✓o_✓l being passed to an object.  Sym-
  212.   bols cannot be created using _✓n_✓e_✓w.  Symbols are guaranteed to
  213.   have unique representations; that is, two symbols represent-
  214.   ing the same characters  will  always  test  equal  to  each
  215.   other.  Inside of literal arrays, the leading pound signs on
  216.   symbols can be eliminated, for  example:  #(these  are  sym-
  217.   bols).
  218.  
  219.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  220.  
  221.   _✓r ==           Return true if the two symbols represent  the
  222.                  same characters, false otherwise.
  223.  
  224.   _✓r asString     Return a String representation of the  symbol
  225.                  without the leading pound sign.
  226.  
  227.   _✓r printString  Return a String representation of the symbol,
  228.                  including the leading pound sign.
  229.  
  230.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  231.  
  232.                                           Printed result
  233.  
  234.   #abc == #abc                            True
  235.   #abc == #ABC                            False
  236.   #abc ~~ #ABC                            True
  237.   #abc printString                        #abc
  238.   'abc' asSymbol                          #abc
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.   Object
  272.     B✓B✓B✓Bo✓o✓o✓oo✓o✓o✓ol✓l✓l✓le✓e✓e✓ea✓a✓a✓an✓n✓n✓n
  273.  
  274.        The class B✓B✓B✓Bo✓o✓o✓oo✓o✓o✓ol✓l✓l✓le✓e✓e✓ea✓a✓a✓an✓n✓n✓n provides  protocol  for  manipulating
  275.   true  and false values.  The pseudo variables t✓t✓t✓tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e and f✓f✓f✓fa✓a✓a✓al✓l✓l✓ls✓s✓s✓se✓e✓e✓e
  276.   are instances of the subclasses of B✓B✓B✓Bo✓o✓o✓oo✓o✓o✓ol✓l✓l✓le✓e✓e✓ea✓a✓a✓an✓n✓n✓n; T✓T✓T✓Tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e and  F✓F✓F✓Fa✓a✓a✓al✓l✓l✓ls✓s✓s✓se✓e✓e✓e,
  277.   respectively.  The subclasses T✓T✓T✓Tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e and F✓F✓F✓Fa✓a✓a✓al✓l✓l✓ls✓s✓s✓se✓e✓e✓e, in combination
  278.   with blocks,  are  used  to  implement  conditional  control
  279.   structures.   Note, however, that the bytecodes may optimize
  280.   conditional tests by generating code  in-line,  rather  than
  281.   using  message  passing.   Note that bit-wise boolean opera-
  282.   tions are provided by class I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r.
  283.  
  284.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  285.  
  286.     &            The argument must be a boolean.   Return  the
  287.                  logical conjunction (and) of the two values.
  288.  
  289.     |            The argument must be a boolean.   Return  the
  290.                  logical disjunction (or) of the two values.
  291.  
  292.     and:         The argument must be  a  block.   Return  the
  293.                  logical  conjunction (and) of the two values.
  294.                  If the receiver is false the second  argument
  295.                  is  not  used,  otherwise  the  result is the
  296.                  value  yielded  in  evaluating  the  argument
  297.                  block.
  298.  
  299.     or:          The argument must be  a  block.   Return  the
  300.                  logical  disjunction  (or) of the two values.
  301.                  If the receiver is true the  second  argument
  302.                  is  not  used,  otherwise  the  result is the
  303.                  value  yielded  in  evaluating  the  argument
  304.                  block.
  305.  
  306.     eqv:         The argument must be a boolean.   Return  the
  307.                  logical equivalence (eqv) of the two values.
  308.  
  309.     xor:         The argument must be a boolean.   Return  the
  310.                  logical exclusive or (xor) of the two values.
  311.  
  312.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  313.  
  314.                                           Printed result
  315.  
  316.   (1 > 3) & (2 < 4)                       False
  317.   (1 > 3) | (2 < 4)                       True
  318.   (1 > 3) and: [2 < 4]                    False
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.   Object
  338.     Boolean
  339.       T✓T✓T✓Tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e
  340.  
  341.        The pseudo variable t✓t✓t✓tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e is an  instance  (usually  the
  342.   only instance) of the class T✓T✓T✓Tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e.
  343.  
  344.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  345.  
  346.     ifTrue:      Return the result of evaluating the  argument
  347.                  block.
  348.  
  349.     ifFalse:     Return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l.
  350.  
  351.     ifTrue:ifFalse:
  352.                  Return the result  of  evaluating  the  first
  353.                  argument block.
  354.  
  355.     ifFalse:ifTrue:
  356.                  Return the result of  evaluating  the  second
  357.                  argument block.
  358.  
  359.     not          Return f✓f✓f✓fa✓a✓a✓al✓l✓l✓ls✓s✓s✓se✓e✓e✓e.
  360.  
  361.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  362.  
  363.                                           Printed result
  364.  
  365.   (3 < 5) not                             False
  366.   (3 < 5) ifTrue: [17]                    17
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.   Object
  404.     Boolean
  405.       F✓F✓F✓Fa✓a✓a✓al✓l✓l✓ls✓s✓s✓se✓e✓e✓e
  406.  
  407.        The pseudo variable f✓f✓f✓fa✓a✓a✓al✓l✓l✓ls✓s✓s✓se✓e✓e✓e is an instance  (usually  the
  408.   only instance) of the class F✓F✓F✓Fa✓a✓a✓al✓l✓l✓ls✓s✓s✓se✓e✓e✓e.
  409.  
  410.     ifTrue:      Return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l.
  411.  
  412.     ifFalse:     Return the result of evaluating the  argument
  413.                  block.
  414.  
  415.     ifTrue:ifFalse:
  416.                  Return the result of  evaluating  the  second
  417.                  argument block.
  418.  
  419.     ifFalse:ifTrue:
  420.                  Return the result  of  evaluating  the  first
  421.                  argument block.
  422.  
  423.     not          Return t✓t✓t✓tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e.
  424.  
  425.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  426.  
  427.                                           Printed result
  428.  
  429.   (1 < 3) ifTrue: [17]                    17
  430.   (1 < 3) ifFalse: [17]                   nil
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.   Object
  470.     M✓M✓M✓Ma✓a✓a✓ag✓g✓g✓gn✓n✓n✓ni✓i✓i✓it✓t✓t✓tu✓u✓u✓ud✓d✓d✓de✓e✓e✓e
  471.  
  472.        The class M✓M✓M✓Ma✓a✓a✓ag✓g✓g✓gn✓n✓n✓ni✓i✓i✓it✓t✓t✓tu✓u✓u✓ud✓d✓d✓de✓e✓e✓e provides protocol for  those  subc-
  473.   lasses  possessing a linear ordering.  For the sake of effi-
  474.   ciency, most subclasses redefine some or all  of  the  rela-
  475.   tional  messages.   All  methods are defined in terms of the
  476.   basic messages <, = and >, which are in turn defined  circu-
  477.   larly  in terms of each other.  Thus each subclass of M✓M✓M✓Ma✓a✓a✓ag✓g✓g✓gn✓n✓n✓ni✓i✓i✓i-✓-✓-✓-
  478.   t✓t✓t✓tu✓u✓u✓ud✓d✓d✓de✓e✓e✓e must redefine at least one of these messages.
  479.  
  480.     <            Relational  less  than   test.    Returns   a
  481.                  boolean.
  482.  
  483.     <=           Relational less than or equal test.
  484.  
  485.     =            Relational  equal  test.   Note   that   this
  486.                  differs  from ==, which is an object equality
  487.                  test.
  488.  
  489.     ~=           Relational not equal test, opposite of =.
  490.  
  491.     >=           Relational greater than or equal test.
  492.  
  493.     >            Relational greater than test.
  494.  
  495.     between:and: Relational test for inclusion.
  496.  
  497.     max:         Return the maximum of the receiver and  argu-
  498.                  ment value.
  499.  
  500.     min:         Return the minimum of the receiver and  argu-
  501.                  ment value.
  502.  
  503.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  504.  
  505.                                           Printed result
  506.  
  507.   $A max: $a                              $a
  508.   4 between: 3.1 and: (17/3)              True
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.   Object
  536.     Magnitude
  537.       C✓C✓C✓Ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r
  538.  
  539.        This class defines protocol for objects with  character
  540.   values.   Characters possess an ordering given by the under-
  541.   lying representation, however arithmetic is not defined  for
  542.   character  values.   Characters  are  written  literally  by
  543.   preceding the character desired  with  a  dollar  sign,  for
  544.   example: $a   $B   $$.
  545.  
  546.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  547.  
  548.   _✓r ==           Object equality test.  Two instances  of  the
  549.                  same character always test equal.
  550.  
  551.     asciiValue   Return  an  I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r  representing  the  ascii
  552.                  value of the receiver.
  553.  
  554.     asLowercase  If  the  receiver  is  an  uppercase   letter
  555.                  returns  the same letter in lowercase, other-
  556.                  wise returns the receiver.
  557.  
  558.     asUppercase  If the receiver is a lowercase letter returns
  559.                  the   same  letter  in  uppercase,  otherwise
  560.                  returns the receiver.
  561.  
  562.   _✓r asString     Return a length  one  string  containing  the
  563.                  receiver.   Does  not  contain leading dollar
  564.                  sign, compare to _✓p_✓r_✓i_✓n_✓t_✓S_✓t_✓r_✓i_✓n_✓g.
  565.  
  566.     digitValue   If the  receiver  represents  a  number  (for
  567.                  example  $9)  return  the  digit value of the
  568.                  number.  If  the  receiver  is  an  uppercase
  569.                  letter  (for  example $B) return the position
  570.                  of the number in the uppercase letters +  10,
  571.                  ($B   returns   11,  for  example).   If  the
  572.                  receiver is neither a digit nor an  uppercase
  573.                  letter an error is given and n✓n✓n✓ni✓i✓i✓il✓l✓l✓l returned.
  574.  
  575.     isAlphaNumericRespond true if receiver is either digit  or
  576.                  letter, false otherwise.
  577.  
  578.     isDigit      Respond true if receiver is  a  digit,  false
  579.                  otherwise.
  580.  
  581.     isLetter     Respond true if receiver is a  letter,  false
  582.                  otherwise.
  583.  
  584.     isLowercase  Respond  true  if  receiver  is  a  lowercase
  585.                  letter, false otherwise.
  586.  
  587.     isSeparator  Respond true if receiver is a space,  tab  or
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.   class C✓C✓C✓Ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓r (continued)
  599.  
  600.  
  601.                  newline, false otherwise.
  602.  
  603.     isUppercase  Respond true  if  receiver  is  an  uppercase
  604.                  letter, false otherwise.
  605.  
  606.     isVowel      Respond true if receiver is $a, $e, $i, $o or
  607.                  $u, in either upper or lower case.
  608.  
  609.   _✓r printString  Respond with a string representation  of  the
  610.                  character  value.   Includes  leading  dollar
  611.                  sign, compare to  _✓a_✓s_✓S_✓t_✓r_✓i_✓n_✓g,  which  does  not
  612.                  include $.
  613.  
  614.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  615.  
  616.                                           Printed result
  617.  
  618.   $A < $0                                 False
  619.   $A asciiValue                           65
  620.   $A asString                             A
  621.   $A printString                          $A
  622.   $A isVowel                              True
  623.   $A digitValue                           10
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.   Object
  668.     Magnitude
  669.       N✓N✓N✓Nu✓u✓u✓um✓m✓m✓mb✓b✓b✓be✓e✓e✓er✓r✓r✓r
  670.  
  671.        The class N✓N✓N✓Nu✓u✓u✓um✓m✓m✓mb✓b✓b✓be✓e✓e✓er✓r✓r✓r is an abstract superclass for  I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r
  672.   and  F✓F✓F✓Fl✓l✓l✓lo✓o✓o✓oa✓a✓a✓at✓t✓t✓t.  Instances of N✓N✓N✓Nu✓u✓u✓um✓m✓m✓mb✓b✓b✓be✓e✓e✓er✓r✓r✓r cannot be created directly.
  673.   Relational messages and many arithmetic messages  are  rede-
  674.   fined  in  each  subclass  for  arguments of the appropriate
  675.   type.  In  general,  an  error  message  is  given  and  n✓n✓n✓ni✓i✓i✓il✓l✓l✓l
  676.   returned for illegal arguments.
  677.  
  678.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  679.  
  680.     +            Mixed type addition.
  681.  
  682.     -            Mixed type subtraction.
  683.  
  684.     *            Mixed type multiplication
  685.  
  686.     /            Mixed type division.
  687.  
  688.   _✓n |✓^            Exponentiation, same as raisedTo: .
  689.  
  690.     @            Construct a point with coordinates being  the
  691.                  receiver and the argument.
  692.  
  693.     abs          Absolute value of the receiver.
  694.  
  695.     exp          e raised to the power.
  696.  
  697.   _✓n gamma        Return the gamma function  (generalized  fac-
  698.                  torial) evaluated at the receiver.
  699.  
  700.     ln           Natural logarithm of the receiver.
  701.  
  702.     log:         Logarithm in the given base.
  703.  
  704.     negated      The arithmetic inverse of the receiver.
  705.  
  706.     negative     True if the receiver is negative.
  707.  
  708.   _✓n pi           Return the approximate value of the  receiver
  709.                  multiplied by  (3.1415926...).
  710.  
  711.     positive     True if the receiver is positive.
  712.  
  713.   _✓n radians      Argument converted into radians.
  714.  
  715.     raisedTo:    The receiver raised to the argument value.
  716.  
  717.     reciprocal   The arithmetic reciprocal of the receiver.
  718.  
  719.     roundTo:     The receiver rounded to units  of  the  argu-
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.   class N✓N✓N✓Nu✓u✓u✓um✓m✓m✓mb✓b✓b✓be✓e✓e✓er✓r✓r✓r (continued)
  731.  
  732.  
  733.                  ment.
  734.  
  735.     sign         Return -1, 0 or 1 depending upon whether  the
  736.                  receiver is negative, zero or positive.
  737.  
  738.     sqrt         Square root.  nil if receiver  is  less  than
  739.                  zero.
  740.  
  741.     squared      Return the receiver multiplied by itself.
  742.  
  743.     strictlyPositive
  744.                  True if the receiver is greater than zero.
  745.  
  746.     to:          Interval from receiver to argument value with
  747.                  step of 1.
  748.  
  749.     to:by:       Interval from receiver to argument  in  given
  750.                  steps.
  751.  
  752.     truncatedTo: The receiver truncated to units of the  argu-
  753.                  ment.
  754.  
  755.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  756.  
  757.                                           Printed result
  758.  
  759.   3 < 4.1                                 True
  760.   3 + 4.1                                 7.1
  761.   3.14159 exp                             23.1406
  762.   9 gamma                                 40320
  763.   5 reciprocal                            0.2
  764.   0.5 radians                             0.5 radians
  765.   13 roundTo: 5                           15
  766.   13 truncateTo: 5                        10
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.   Object
  800.     Magnitude
  801.       Number
  802.         I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r
  803.  
  804.        The class I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r provides protocol  for  objects  with
  805.   integer values.
  806.  
  807.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  808.  
  809.   _✓r ==           Object   equality   test.     Two    integers
  810.                  representing the same value are considered to
  811.                  be the same object.
  812.  
  813.     //           Integer quotient, truncated towards  negative
  814.                  infinity (compare to _✓q_✓u_✓o:).
  815.  
  816.     \\           Integer remainder, truncated towards negative
  817.                  infinity (compare to _✓r_✓e_✓m:).
  818.  
  819.     allMask:     Argument must be I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r.  Treating  receiver
  820.                  and  argument  as bit strings, return t✓t✓t✓tr✓r✓r✓ru✓u✓u✓ue✓e✓e✓e if
  821.                  all bits with 1 value in argument  correspond
  822.                  to bits with 1 values in the receiver.
  823.  
  824.     anyMask:     Argument must be I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r.  Treating  receiver
  825.                  and  argument  as bit strings, return true if
  826.                  any bit with 1 value in argument  corresponds
  827.                  to a bit with 1 value in the receiver.
  828.  
  829.     asCharacter  Return the  Char  with  the  same  underlying
  830.                  ascii  representation  as the low order eight
  831.                  bits of the receiver.
  832.  
  833.     asFloat      Floating point value with same  magnitude  as
  834.                  receiver.
  835.  
  836.     bitAnd:      Argument  must  be  I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r.   Treating   the
  837.                  receiver  and argument as bit strings, return
  838.                  logical a✓a✓a✓an✓n✓n✓nd✓d✓d✓d of values.
  839.  
  840.     bitAt:       Argument must be I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r greater than  0  and
  841.                  less  than  underlying  word  size.  Treating
  842.                  receiver as a  bit  string,  return  the  bit
  843.                  value  at  the given position, numbering from
  844.                  low order (or rightmost) position.
  845.  
  846.     bitInvert    Return the receiver with  all  bit  positions
  847.                  inverted.
  848.  
  849.     bitOr:       Return logical o✓o✓o✓or✓r✓r✓r of values.
  850.  
  851.     bitShift:    Treating the receiver as a bit string,  shift
  852.                  bit  values  by amount indicated in argument.
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.   class I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r (continued)
  863.  
  864.  
  865.                  Negative values shift right, positive left.
  866.  
  867.     bitXor:      Return logical e✓e✓e✓ex✓x✓x✓xc✓c✓c✓cl✓l✓l✓lu✓u✓u✓us✓s✓s✓si✓i✓i✓iv✓v✓v✓ve✓e✓e✓e-✓-✓-✓-o✓o✓o✓or✓r✓r✓r of values.
  868.  
  869.     even         Return true if receiver is even, false other-
  870.                  wise.
  871.  
  872.     factorial    Return the factorial of the receiver.  Return
  873.                  as Float for large numbers.
  874.  
  875.     gcd:         Argument  must  be   I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r.    Return   the
  876.                  greatest  common  divisor of the receiver and
  877.                  argument.
  878.  
  879.     highBit      Return the location of the highest 1  bit  in
  880.                  the receiver.  Return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l for receiver zero.
  881.  
  882.     lcm:         Argument must be I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r.  Return least  com-
  883.                  mon multiple of receiver and argument.
  884.  
  885.     noMask:      Argument must be I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r.  Treating  receiver
  886.                  and  argument  as bit strings, return true if
  887.                  no 1 bit in the argument corresponds to  a  1
  888.                  bit in the receiver.
  889.  
  890.     odd          Return true if receiver is odd, false  other-
  891.                  wise.
  892.  
  893.     quo:         Return quotient of receiver divided by  argu-
  894.                  ment.
  895.  
  896.     radix:       Return  a  string   representation   of   the
  897.                  receiver   value,   printed   in   the   base
  898.                  represented by the argument.  Argument  value
  899.                  must be less than 36.
  900.  
  901.     rem:         Remainder after receiver is divided by  argu-
  902.                  ment value.
  903.  
  904.     timesRepeat: Repeat argument block  the  number  of  times
  905.                  given by the receiver.
  906.  
  907.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  908.  
  909.                                           Printed result
  910.  
  911.   5 + 4                                   7
  912.   5 allMask: 4                            True
  913.   4 allMask: 5                            False
  914.   5 anyMask: 4                            True
  915.   5 bitAnd: 3                             1
  916.   5 bitOr: 3                              7
  917.   5 bitInvert                             -6
  918.   254 radix: 16                           16rFE
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.   class I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓eg✓g✓g✓ge✓e✓e✓er✓r✓r✓r (continued)
  929.  
  930.  
  931.   -5 // 4                                 -2
  932.   -5 quo: 4                               -1
  933.   -5 \\ 4                                 1
  934.   -5 rem: 4                               -1
  935.   8 factorial                             40320
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.   Object
  998.     Magnitude
  999.       Number
  1000.         F✓F✓F✓Fl✓l✓l✓lo✓o✓o✓oa✓a✓a✓at✓t✓t✓t
  1001.  
  1002.        The class F✓F✓F✓Fl✓l✓l✓lo✓o✓o✓oa✓a✓a✓at✓t✓t✓t  provides  protocol  for  objects  with
  1003.   floating point values.
  1004.  
  1005.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  1006.  
  1007.   _✓r ==           Object equality test.   Return  true  if  the
  1008.                  receiver  and  argument  represent  the  same
  1009.                  floating point value.
  1010.  
  1011.   _✓n |✓^            Floating exponentiation.
  1012.  
  1013.     arcCos       Return a R✓R✓R✓Ra✓a✓a✓ad✓d✓d✓di✓i✓i✓ia✓a✓a✓an✓n✓n✓n representing  the  arcCos  of
  1014.                  the receiver.
  1015.  
  1016.     arcSin       Return a R✓R✓R✓Ra✓a✓a✓ad✓d✓d✓di✓i✓i✓ia✓a✓a✓an✓n✓n✓n representing  the  arcSin  of
  1017.                  the receiver.
  1018.  
  1019.     arcTan       Return a R✓R✓R✓Ra✓a✓a✓ad✓d✓d✓di✓i✓i✓ia✓a✓a✓an✓n✓n✓n representing  the  arcTan  of
  1020.                  the receiver.
  1021.  
  1022.     asFloat      Return the receiver.
  1023.  
  1024.     ceiling      Return the Integer ceiling of the receiver.
  1025.  
  1026.     coerce:      Coerce the argument into being type Float.
  1027.  
  1028.     exp          Return e raised to the receiver value.
  1029.  
  1030.     floor        Return the Integer floor of the receiver.
  1031.  
  1032.     fractionPart Return the fractional part of the receiver.
  1033.  
  1034.   _✓n gamma        Return  the  value  of  the  gamma   function
  1035.                  applied to the receiver value.
  1036.  
  1037.     integerPart  Return the integer part of the receiver.
  1038.  
  1039.     ln           Return the natural log of the receiver.
  1040.  
  1041.     radix:       Return  a  string  containing  the  printable
  1042.                  representation  of  the receiver in the given
  1043.                  radix.  Argument must be an Integer less than
  1044.                  36.
  1045.  
  1046.     rounded      Return the receiver rounded  to  the  nearest
  1047.                  integer.
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.   class F✓F✓F✓Fl✓l✓l✓lo✓o✓o✓oa✓a✓a✓at✓t✓t✓t (continued)
  1061.  
  1062.  
  1063.     sqrt         Return the square root of the receiver.
  1064.  
  1065.     truncated    Return the receiver truncated to the  nearest
  1066.                  integer.
  1067.  
  1068.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1069.  
  1070.                                           Printed result
  1071.  
  1072.   4.2 * 3                                 12.6
  1073.   2.1 |✓^ 4                                 19.4481
  1074.   2.1 raisedTo: 4                         19.4481
  1075.   0.5 arcSin                              0.523599 radians
  1076.   2.1 reciprocal                          0.47619
  1077.   4.3 sqrt                                2.07364
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.   Object
  1130.     Magnitude
  1131.       R✓R✓R✓Ra✓a✓a✓ad✓d✓d✓di✓i✓i✓ia✓a✓a✓an✓n✓n✓n
  1132.  
  1133.        The class R✓R✓R✓Ra✓a✓a✓ad✓d✓d✓di✓i✓i✓ia✓a✓a✓an✓n✓n✓n is used to represent radians.  Radians
  1134.   are  a  unit  of  measurement, independent of other numbers.
  1135.   Only radians will responds to  the  trigonometric  functions
  1136.   such  as _✓s_✓i_✓n and _✓c_✓o_✓s.  Numbers can be converted into radians
  1137.   by passing them the message _✓r_✓a_✓d_✓i_✓a_✓n_✓s.  Similarly, radians can
  1138.   be  converted  into  numbers  by  sending  them  the message
  1139.   _✓a_✓s_✓F_✓l_✓o_✓a_✓t.  Notice that only a  limited  range  of  arithmetic
  1140.   operations are permitted on Radians.  Radians are normalized
  1141.   to be between 0 and 2J.
  1142.  
  1143.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  1144.  
  1145.     +            Argument must be a Radian.  Add the two radi-
  1146.                  ans   together   and  return  the  normalized
  1147.                  result.
  1148.  
  1149.     -            Argument must  be  a  Radian.   Subtract  the
  1150.                  argument  from  the  receiver  and return the
  1151.                  normalized result.
  1152.  
  1153.     *            Argument must  be  a  Number.   Multiply  the
  1154.                  receiver  by  the  argument amount and return
  1155.                  the normalized result.
  1156.  
  1157.     /            Argument  must  be  a  Number.   Divide   the
  1158.                  receiver  by  the  argument amount and return
  1159.                  the normalized result.
  1160.  
  1161.     asFloat      Return  the  receiver  as  a  floating  point
  1162.                  number.
  1163.  
  1164.     cos          Return a floating point  number  representing
  1165.                  the cosine of the receiver.
  1166.  
  1167.     sin          Return a floating point  number  representing
  1168.                  the sine of the receiver.
  1169.  
  1170.     tan          Return a floating point  number  representing
  1171.                  the tangent of the receiver.
  1172.  
  1173.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1174.  
  1175.                                           Printed result
  1176.  
  1177.   0.5236 radians sin                      0.5
  1178.   0.5236 radians cos                      0.866025
  1179.   0.5236 radians tan                      0.577352
  1180.   0.5 arcSin asFloat                      0.523599
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.   Object
  1196.     Magnitude
  1197.       P✓P✓P✓Po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓t
  1198.  
  1199.        P✓P✓P✓Po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓ts are used to represent pairs of quantities,  such
  1200.   as coordinate pairs.
  1201.  
  1202.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  1203.  
  1204.     <            True if both values of the receiver are  less
  1205.                  than  the  corresponding  values in the argu-
  1206.                  ment.
  1207.  
  1208.     <=           True if the first value is less than or equal
  1209.                  to  the  corresponding value in the argument,
  1210.                  and  the  second  value  is  less  than   the
  1211.                  corresponding value in the argument.
  1212.  
  1213.     >=           True if  both  values  of  the  receiver  are
  1214.                  greater  than  or  equal to the corresponding
  1215.                  values in the argument.
  1216.  
  1217.     *            Return a new point  with  coordinates  multi-
  1218.                  plied by the argument value.
  1219.  
  1220.     /            Return a new point with  coordinates  divided
  1221.                  by the argument value.
  1222.  
  1223.     //           Return a new point with  coordinates  divided
  1224.                  by the argument value.
  1225.  
  1226.     +            Return a new point with coordinates offset by
  1227.                  the corresponding values in the argument.
  1228.  
  1229.     abs          Return a new point  with  coordinates  having
  1230.                  the absolute value of the receiver.
  1231.  
  1232.     dist:        Return the  Euclidean  distance  between  the
  1233.                  receiver and the argument point.
  1234.  
  1235.     max:         The argument must be  a  P✓P✓P✓Po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓t.   Return  the
  1236.                  lower  right  corner of the rectangle defined
  1237.                  by the receiver and the argument.
  1238.  
  1239.     min:         The argument must be  a  P✓P✓P✓Po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓t.   Return  the
  1240.                  upper left corner of the rectangle defined by
  1241.                  the receiver and the argument.
  1242.  
  1243.     transpose    Return a new point with coordinates being the
  1244.                  transpose of the receiver.
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.   class P✓P✓P✓Po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓t (continued)
  1259.  
  1260.  
  1261.     x            Return the first coordinate of the receiver.
  1262.  
  1263.     x:           Set the first coordinate of the receiver.
  1264.  
  1265.     x:y:         Sets both coordinates of the receiver.
  1266.  
  1267.     y            Return the second coordinate of the receiver.
  1268.  
  1269.     y:           Set the second coordinate of the receiver.
  1270.  
  1271.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1272.  
  1273.                                           Printed result
  1274.  
  1275.   (10@12) < (11@14)                       True
  1276.   (10@12) < (11@11)                       False
  1277.   (10@12) max: (11@11)                    11@12
  1278.   (10@12) min: (11@11)                    10@11
  1279.   (10@12) dist: (11@14)                   2.23607
  1280.   (10@12) transpose                       12@10
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.   Object
  1328.     R✓R✓R✓Ra✓a✓a✓an✓n✓n✓nd✓d✓d✓do✓o✓o✓om✓m✓m✓m
  1329.  
  1330.        The class R✓R✓R✓Ra✓a✓a✓an✓n✓n✓nd✓d✓d✓do✓o✓o✓om✓m✓m✓m provides protocol  for  random  number
  1331.   generation.  Sending the message _✓n_✓e_✓x_✓t to an instance of R✓R✓R✓Ra✓a✓a✓an✓n✓n✓n-✓-✓-✓-
  1332.   d✓d✓d✓do✓o✓o✓om✓m✓m✓m results in a F✓F✓F✓Fl✓l✓l✓lo✓o✓o✓oa✓a✓a✓at✓t✓t✓t between 0.0 and 1.0, randomly distri-
  1333.   buted.   By  default, the pseudo random sequence is the same
  1334.   for each object in class R✓R✓R✓Ra✓a✓a✓an✓n✓n✓nd✓d✓d✓do✓o✓o✓om✓m✓m✓m.  This can be altered  using
  1335.   the message _✓r_✓a_✓n_✓d_✓o_✓m_✓i_✓z_✓e.
  1336.  
  1337.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  1338.  
  1339.   _✓n between:and: Return a random number uniformly  distributed
  1340.                  between the two arguments.
  1341.  
  1342.   _✓n first        Return a random number between 0.0  and  1.0.
  1343.                  This message merely provides consistency with
  1344.                  protocol for other sequences, such as  Arrays
  1345.                  or Intervals.
  1346.  
  1347.     next         Return a random number between 0.0 and 1.0.
  1348.  
  1349.   _✓d next:        Return an A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y containing the next n  random
  1350.                  numbers, where n is the argument value.
  1351.  
  1352.   _✓n randInteger: The argument must be an  integer.   Return  a
  1353.                  random integer between 1 and the value given.
  1354.  
  1355.   _✓n randomize    Change  the  pseudo-random  number  generator
  1356.                  seed by a time dependent value.
  1357.  
  1358.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1359.  
  1360.                                           Printed result
  1361.  
  1362.   i <- Random new
  1363.   i next                                  0.759
  1364.   i next                                  0.157
  1365.   i next: 3                               #( 0.408 0.278 0.547 )
  1366.   i randInteger: 12                       5
  1367.   i between: 4 and: 17.5                  10.0
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.   Object
  1394.     C✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n
  1395.  
  1396.        The class C✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n provides protocol  for  groups  of
  1397.   objects, such as A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ys or S✓S✓S✓Se✓e✓e✓et✓t✓t✓ts. The different forms of col-
  1398.   lections are distinguished by several characteristics, among
  1399.   them  whether  the  size  of  the  collection  is  fixed  or
  1400.   unbounded, the presence or absence of an ordering, and their
  1401.   insertion or access method.  For example, an A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y is a col-
  1402.   lection with a fixed size and ordering, indexed  by  integer
  1403.   keys.  A D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓y, on the other hand, has no fixed size or
  1404.   ordering,  and  can  be  indexed  by   arbitrary   elements.
  1405.   Nevertheless,  A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ys✓s✓s✓s and D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓ys✓s✓s✓s share many features in
  1406.   common, such as their access method (_✓a_✓t: and  _✓a_✓t:_✓p_✓u_✓t:),  and
  1407.   the  ability to respond to _✓c_✓o_✓l_✓l_✓e_✓c_✓t:, _✓s_✓e_✓l_✓e_✓c_✓t:, and many other
  1408.   messages.
  1409.  
  1410.        The table below lists some of  the  characteristics  of
  1411.   several forms of collections:
  1412.  
  1413.   ___________________________________________________________________
  1414.  
  1415.    Name         Creation    Size    Ordered?   Insertion    Access
  1416.                  Method    fixed?               method      method
  1417.  
  1418.   ___________________________________________________________________
  1419.  
  1420.    Bag/Set        new        no        no        add:      includes:
  1421.  
  1422.    Dictionary     new        no        no       at:put:       at:
  1423.  
  1424.    Interval     n to: m     yes       yes        none         at:
  1425.  
  1426.    List           new        no       yes      addFirst:     first
  1427.                                                addLast:      last
  1428.  
  1429.    Array          new:      yes       yes       at:put:       at:
  1430.  
  1431.    String         new:      yes       yes       at:put:       at:
  1432.  
  1433.   ___________________________________________________________________
  1434.   |✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.                                                                      |✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.        The list below shows messages that are shared in common
  1474.   by all collections.
  1475.  
  1476.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  1477.  
  1478.     addAll:      The argument must be a C✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n.   Add  all
  1479.                  the  elements  of  the argument collection to
  1480.                  the receiver collection.
  1481.  
  1482.     asArray      Return a new collection of  type  A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y  con-
  1483.                  taining  the  elements from the receiver col-
  1484.                  lection.  If the receiver  was  ordered,  the
  1485.                  elements will be in the same order in the new
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.   class C✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n (continued)
  1494.  
  1495.  
  1496.                  collection, otherwise the elements will be in
  1497.                  an arbitrary order.
  1498.  
  1499.     asBag        Return a new collection of type B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓g  contain-
  1500.                  ing  the  elements  from the receiver collec-
  1501.                  tion.
  1502.  
  1503.   _✓n asList       Return a new collection of type L✓L✓L✓Li✓i✓i✓is✓s✓s✓st✓t✓t✓t contain-
  1504.                  ing  the  elements  from the receiver collec-
  1505.                  tion.  If the receiver was ordered, the  ele-
  1506.                  ments  will  be  in the same order in the new
  1507.                  collection, otherwise the elements will be in
  1508.                  an arbitrary order.
  1509.  
  1510.     asSet        Return a new collection of type S✓S✓S✓Se✓e✓e✓et✓t✓t✓t  contain-
  1511.                  ing  the  elements  from the receiver collec-
  1512.                  tion.
  1513.  
  1514.     asString     Return a new collection of type  S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g  con-
  1515.                  taining  the  elements from the receiver col-
  1516.                  lection.  The elements to  be  included  must
  1517.                  all  be  of  type C✓C✓C✓Ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓ra✓a✓a✓ac✓c✓c✓ct✓t✓t✓te✓e✓e✓er✓r✓r✓r.  If the receiver
  1518.                  was ordered, the elements will be in the same
  1519.                  order  in  the  new collection, otherwise the
  1520.                  elements  will  be  listed  in  an  arbitrary
  1521.                  order.
  1522.  
  1523.     coerce:      The argument must be a collection.  Return  a
  1524.                  collection, of the same type as the receiver,
  1525.                  containing elements from the argument collec-
  1526.                  tion.   This  message  is  redefined  in most
  1527.                  subclasses of collection.
  1528.  
  1529.     collect:     The argument must be a  one  argument  block.
  1530.                  Return  a  new collection, like the receiver,
  1531.                  containing the result of evaluating the argu-
  1532.                  ment  block  on  each element of the receiver
  1533.                  collection.
  1534.  
  1535.     detect:      The argument must be a  one  argument  block.
  1536.                  Return the first element in the receiver col-
  1537.                  lection for which the argument  block  evalu-
  1538.                  ates true.  Report an error and return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l if
  1539.                  no such element exists.  Note that  in  unor-
  1540.                  dered  collections  (such as B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓gs✓s✓s✓s or D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n-✓-✓-✓-
  1541.                  a✓a✓a✓ar✓r✓r✓ry✓y✓y✓ys✓s✓s✓s) the first  element  to  be  encountered
  1542.                  that  will  satisfy  the condition may not be
  1543.                  easily predictable.
  1544.  
  1545.     detect:ifAbsent:
  1546.                  Return the first element in the receiver col-
  1547.                  lection  for  which  the first argument block
  1548.                  evaluates  true.   Return   the   result   of
  1549.                  evaluating  the  second  argument  if no such
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.   class C✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n (continued)
  1560.  
  1561.  
  1562.                  element exists.
  1563.  
  1564.     do:          The argument must be a  one  argument  block.
  1565.                  Evaluate  the  argument block on each element
  1566.                  in the receiver collection.
  1567.  
  1568.     includes:    Return true if the receiver  collection  con-
  1569.                  tains the argument.
  1570.  
  1571.     inject:into: The first  argument  must  be  a  value,  the
  1572.                  second  a  two  argument  block.   The second
  1573.                  argument is evaluated once for  each  element
  1574.                  in  the receiver collection, passing as argu-
  1575.                  ments the result of the  previous  evaluation
  1576.                  (starting  with  the  first argument) and the
  1577.                  element.  The value  returned  is  the  final
  1578.                  value generated.
  1579.  
  1580.     isEmpty      Return true if the receiver  collection  con-
  1581.                  tains no elements.
  1582.  
  1583.     occurrencesOf:Return the  number  of  times  the  argument
  1584.                  occurs in the receiver collection.
  1585.  
  1586.     remove:      Remove the argument from the receiver collec-
  1587.                  tion.   Report an error if the element is not
  1588.                  contained in the receiver collection.
  1589.  
  1590.     remove:ifAbsent:
  1591.                  Remove the first argument from  the  receiver
  1592.                  collection.   Evaluate the second argument if
  1593.                  not present.
  1594.  
  1595.     reject:      The argument must be a  one  argument  block.
  1596.                  Return  a  new  collection  like the receiver
  1597.                  containing all elements for which  the  argu-
  1598.                  ment block returns false.
  1599.  
  1600.     select:      The argument must be a  one  argument  block.
  1601.                  Return  a  new  collection  like the receiver
  1602.                  containing all elements for which  the  argu-
  1603.                  ment block returns true.
  1604.  
  1605.     size         Return the number of elements in the receiver
  1606.                  collection.
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.   class C✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n (continued)
  1626.  
  1627.  
  1628.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1629.  
  1630.                                           Printed result
  1631.  
  1632.   i <- 'abacadabra'
  1633.   i size                                  10
  1634.   i asArray                               #( $a $b $a $c $a $d $a $b $r $a )
  1635.   i asBag                                 Bag ( $a $a $a $a $a $r $b $b $c $d)
  1636.   i asSet                                 Set ( $a $r $b $c $d )
  1637.   i occurrencesOf: $a                     5
  1638.   i reject: [:x | x isVowel]              bcdbr
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.   Object
  1695.     Collection
  1696.       B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓g/✓/✓/✓/S✓S✓S✓Se✓e✓e✓et✓t✓t✓t
  1697.  
  1698.        B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓gs✓s✓s✓s and S✓S✓S✓Se✓e✓e✓et✓t✓t✓ts✓s✓s✓s are each unordered  collections  of  ele-
  1699.   ments. Elements in the collections do not have keys, but are
  1700.   added and removed directly.  The difference  between  a  B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓g
  1701.   and a S✓S✓S✓Se✓e✓e✓et✓t✓t✓t is that each element can occur any number of times
  1702.   in a B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓g, whereas only one copy is inserted into a S✓S✓S✓Se✓e✓e✓et✓t✓t✓t.
  1703.  
  1704.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  1705.  
  1706.     add:         Add the indicated  element  to  the  receiver
  1707.                  collection.
  1708.  
  1709.     add:withOccurences:
  1710.                  (B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓g only) Add the indicated element  to  the
  1711.                  receiver B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓g the given number of times.
  1712.  
  1713.   _✓n first        Return the first element  from  the  receiver
  1714.                  collection.   As the collection is unordered,
  1715.                  the first element depends upon certain values
  1716.                  in  the  internal  representation, and is not
  1717.                  guaranteed to be any specific element in  the
  1718.                  collection.
  1719.  
  1720.   _✓n next         Return the next element  in  the  collection.
  1721.                  In  conjunction  with _✓f_✓i_✓r_✓s_✓t, this can be used
  1722.                  to access each element of the  collection  in
  1723.                  turn.
  1724.  
  1725.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1726.  
  1727.                                           Printed result
  1728.  
  1729.   i <- (1 to: 6) asBag                    Bag ( 1 2 3 4 5 6 )
  1730.   i size                                  6
  1731.   i select: [:x | (x \\ 2) strictlyPositive]Bag ( 1 3 5 )
  1732.   i collect: [:x | x \\ 3]                Bag ( 0 0 1 1 2 2 )
  1733.   j <- ( i collect: [:x | x \\ 3] ) asSet Set ( 0 1 2 )
  1734.   j size                                  3
  1735.  
  1736.   N✓N✓N✓No✓o✓o✓ot✓t✓t✓te✓e✓e✓e:✓:✓:✓: Since B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓gs✓s✓s✓s and S✓S✓S✓Se✓e✓e✓et✓t✓t✓ts✓s✓s✓s are unordered, there is no way  to
  1737.   establish a mapping between the elements of the Bag i in the
  1738.   example above and the corresponding elements in the  collec-
  1739.   tion that resulted from the message collect: [:x | x \\ 3].
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.   Object
  1761.     Collection
  1762.       K✓K✓K✓Ke✓e✓e✓ey✓y✓y✓ye✓e✓e✓ed✓d✓d✓dC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n
  1763.  
  1764.        The class K✓K✓K✓Ke✓e✓e✓ey✓y✓y✓ye✓e✓e✓ed✓d✓d✓dC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n provides protocol for collec-
  1765.   tions with keys, such as D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓ys✓s✓s✓s and A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ys✓s✓s✓s.  Since each
  1766.   entry in the collection has both a key and value, the method
  1767.   _✓a_✓d_✓d: is no longer appropriate.  Instead, the method _✓a_✓t:_✓p_✓u_✓t:,
  1768.   which provides both a key and a value, must be used.
  1769.  
  1770.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  1771.  
  1772.     asDictionary Return a new collection  of  type  D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓y
  1773.                  containing  the  elements  from  the receiver
  1774.                  collection.
  1775.  
  1776.     at:          Return the item in  the  receiver  collection
  1777.                  whose key matches the argument.  Produces and
  1778.                  error message, and returns nil, if no item is
  1779.                  currently  in  the  receiver collection under
  1780.                  the given key.
  1781.  
  1782.     at:ifAbsent: Return the element stored in  the  dictionary
  1783.                  under  the  key  given by the first argument.
  1784.                  Return the result of  evaluating  the  second
  1785.                  argument if no such element exists.
  1786.  
  1787.     atAll:put:   The first argument must be a collection  con-
  1788.                  taining keys valid for the receiver.  At each
  1789.                  location given by a key in the first argument
  1790.                  place the second argument.
  1791.  
  1792.     binaryDo:    The argument must be a  two  argument  block.
  1793.                  This  message is similar to _✓d_✓o:, however both
  1794.                  the key and the element value are  passed  as
  1795.                  argument to the block.
  1796.  
  1797.     includesKey: Return true if the indicated key is valid for
  1798.                  the receiver collection.
  1799.  
  1800.     indexOf:     Return the key value of the first element  in
  1801.                  the  receiver  collection  matching the argu-
  1802.                  ment.  Produces an error message if  no  such
  1803.                  element  exists.  Note that, as with the mes-
  1804.                  sage _✓d_✓e_✓t_✓e_✓c_✓t:, in  unordered  collections  the
  1805.                  first  element  may not be related in any way
  1806.                  to the order in which  elements  were  placed
  1807.                  into  the collection, but is rather implemen-
  1808.                  tation dependent.
  1809.  
  1810.     indexOf:ifAbsent:
  1811.                  Return the key value of the first element  in
  1812.                  the  receiver  collection  matching the argu-
  1813.                  ment.  Return the result  of  evaluating  the
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.   class K✓K✓K✓Ke✓e✓e✓ey✓y✓y✓ye✓e✓e✓ed✓d✓d✓dC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n (continued)
  1824.  
  1825.  
  1826.                  second argument if no such element exists.
  1827.  
  1828.     keys         Return a Set  containing  the  keys  for  the
  1829.                  receiver collection.
  1830.  
  1831.     keysDo:      The argument must be a  one  argument  block.
  1832.                  Similar to _✓d_✓o:, except that the values passed
  1833.                  to the block are the  keys  of  the  receiver
  1834.                  collection.
  1835.  
  1836.     keysSelect:  Similar to _✓s_✓e_✓l_✓e_✓c_✓t, except that the  selection
  1837.                  is  made  on  the  basis  of  keys instead of
  1838.                  values.
  1839.  
  1840.     removeKey:   Remove the object with the given key from the
  1841.                  receiver collection.  Print an error message,
  1842.                  and return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l, if  no  such  object  exists.
  1843.                  Return the value of the deleted item.
  1844.  
  1845.     removeKey:ifAbsent:
  1846.                  Remove the object with the given key from the
  1847.                  receiver  collection.   Return  the result of
  1848.                  evaluating the second  argument  if  no  such
  1849.                  object exists.
  1850.  
  1851.     values       Return a Bag containing the values  from  the
  1852.                  receiver collection.
  1853.  
  1854.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1855.  
  1856.                                           Printed result
  1857.  
  1858.   i <- 'abacadabra'
  1859.   i atAll: (1 to: 7 by: 2) put: $e        ebecedebra
  1860.   i indexOf: $r                           9
  1861.   i atAll: i keys put: $z                 zzzzzzzzzz
  1862.   i keys                                  Set ( 1 2 3 4 5 6 7 8 9 10 )
  1863.   i values                                Bag ( $z $z $z $z $z $z $z $z $z $z )
  1864.   #(how odd) asDictionary                 Dictionary ( 1 @ #how 2 @ odd )
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.   Object
  1893.     Collection
  1894.       KeyedCollection
  1895.         D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓y
  1896.  
  1897.        A D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓y is an unordered collection of elements, as
  1898.   are  B✓B✓B✓Ba✓a✓a✓ag✓g✓g✓gs✓s✓s✓s and S✓S✓S✓Se✓e✓e✓et✓t✓t✓ts✓s✓s✓s.  However, unlike these collections, ele-
  1899.   ments inserted and removed from a D✓D✓D✓Di✓i✓i✓ic✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓na✓a✓a✓ar✓r✓r✓ry✓y✓y✓y must  reference
  1900.   an explicit key.  Both the key and value portions of an ele-
  1901.   ment can be any  object,  although  commonly  the  keys  are
  1902.   instances of S✓S✓S✓Sy✓y✓y✓ym✓m✓m✓mb✓b✓b✓bo✓o✓o✓ol✓l✓l✓l or N✓N✓N✓Nu✓u✓u✓um✓m✓m✓mb✓b✓b✓be✓e✓e✓er✓r✓r✓r.
  1903.  
  1904.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  1905.  
  1906.     at:put:      Place the second argument into  the  receiver
  1907.                  collection  under  the key given by the first
  1908.                  argument.
  1909.  
  1910.     currentKey   Return the key of the last element yielded in
  1911.                  response to a _✓f_✓i_✓r_✓s_✓t or _✓n_✓e_✓x_✓t request.
  1912.  
  1913.   _✓n first        Return the first element of the receiver col-
  1914.                  lection.   Return nil if the receiver collec-
  1915.                  tion is empty.
  1916.  
  1917.   _✓n next         Return the next element of the receiver  col-
  1918.                  lection, or nil if no such element exists.
  1919.  
  1920.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  1921.  
  1922.                                           Printed result
  1923.  
  1924.   i <- Dictionary new
  1925.   i at: #abc put: #def
  1926.   i at: #pqr put: #tus
  1927.   i at: #xyz put: #wrt
  1928.   i print                       Dictionary ( #abc @ #def #pqr @ #tus #xyz @ #wrt )
  1929.   i size                        3
  1930.   i at: #pqr                    #tus
  1931.   i indexOf: #tus               #pqr
  1932.   i keys                        Set ( #abc #pqr #xyz )
  1933.   i values                      Bag ( #wrt #def # tus )
  1934.   i collect: [:x | x asString at: 2]Dictionary ( #abc @ $e #pqr @ $u #xyz @ $r)
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.   Object
  1959.     Collection
  1960.       KeyedCollection
  1961.         Dictionary
  1962.           S✓S✓S✓Sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k
  1963.  
  1964.        The class S✓S✓S✓Sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k provides protocol  for  the  pseudo
  1965.   variable  s✓s✓s✓sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k.   Since it is a subclass of Dictionary,
  1966.   this variable can be used to  store  information,  and  thus
  1967.   provide  a  means  of  communication between objects.  Other
  1968.   messages  modify  various  parameters  used  by  the  Little
  1969.   Smalltalk system.
  1970.  
  1971.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  1972.  
  1973.   _✓n date         Return the current date and time as a string.
  1974.  
  1975.   _✓n display      Set execution display to display  the  result
  1976.                  of   every  expression  typed,  but  not  for
  1977.                  assignments.  Note that the display  behavior
  1978.                  can also be modified using the -d argument on
  1979.                  the command line.
  1980.  
  1981.   _✓n displayAssignSet execution display to display  the  result
  1982.                  of  every expression typed, including assign-
  1983.                  ment statements.
  1984.  
  1985.   _✓n doPrimitive:withArguments:
  1986.                  Execute the indicated  primitive  with  argu-
  1987.                  ments given by the second array.  A few prim-
  1988.                  itives (such as those  dealing  with  process
  1989.                  management)   cannot   be  executed  in  this
  1990.                  manner.
  1991.  
  1992.   _✓n noDisplay    Turn off execution display - no results  will
  1993.                  be  displayed  unless explicitly requested by
  1994.                  the user.
  1995.  
  1996.   _✓d perform:withArguments:
  1997.                  Send indicated message to the receiver, using
  1998.                  the  arguments given.  The first value in the
  1999.                  argument array is taken to be the receiver of
  2000.                  the  message.   Unpredictable  results if the
  2001.                  number of arguments is  not  appropriate  for
  2002.                  the given message.
  2003.  
  2004.   _✓n sh:          The argument, which must be a string, is exe-
  2005.                  cuted  as  a  Unix command by the shell.  The
  2006.                  value returned is the termination  status  of
  2007.                  the shell.
  2008.  
  2009.   _✓n time:        The argument must be a block.  The  block  is
  2010.                  executed,  and  the number of seconds elapsed
  2011.                  during  execution  returned.   Time  is  only
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.   class S✓S✓S✓Sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k (continued)
  2022.  
  2023.  
  2024.                  accurate to within about one second.
  2025.  
  2026.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2027.  
  2028.                                           Printed result
  2029.  
  2030.   smalltalk date                          Fri Apr 12 16:15:42 1985
  2031.   smalltalk perform: #+ withArguments: #(2 5)7
  2032.   smalltalk doPrimitive: 10 withArguments: #(2 5)7
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.   Object
  2091.     Collection
  2092.       KeyedCollection
  2093.         S✓S✓S✓Se✓e✓e✓eq✓q✓q✓qu✓u✓u✓ue✓e✓e✓en✓n✓n✓nc✓c✓c✓ce✓e✓e✓ea✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓eC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n
  2094.  
  2095.        The class S✓S✓S✓Se✓e✓e✓eq✓q✓q✓qu✓u✓u✓ue✓e✓e✓en✓n✓n✓nc✓c✓c✓ce✓e✓e✓ea✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓eC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n contains protocol  for
  2096.   collections that have a definite sequential ordering and are
  2097.   indexed by integer keys.  Since there is a fixed  order  for
  2098.   elements,  it  is possible to refer to the last element in a
  2099.   S✓S✓S✓Se✓e✓e✓eq✓q✓q✓qu✓u✓u✓ue✓e✓e✓en✓n✓n✓nc✓c✓c✓ce✓e✓e✓ea✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓eC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n.
  2100.  
  2101.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2102.  
  2103.     ,            Appends  the  argument  collection   to   the
  2104.                  receiver  collection, returning a new collec-
  2105.                  tion of the same type as the receiver.
  2106.  
  2107.     copyFrom:to: Return a new collection, like  the  receiver,
  2108.                  containing  the  designated subportion of the
  2109.                  receiver collection.
  2110.  
  2111.     copyWith:    Return a new collection, like  the  receiver,
  2112.                  with the argument added to the end.
  2113.  
  2114.     copyWithout: Return a new collection, like  the  receiver,
  2115.                  with all occurrences of the argument removed.
  2116.  
  2117.     equals:startingAt:
  2118.                  The first argument must be a S✓S✓S✓Se✓e✓e✓eq✓q✓q✓qu✓u✓u✓ue✓e✓e✓en✓n✓n✓nc✓c✓c✓ce✓e✓e✓ea✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓eC✓C✓C✓Co✓o✓o✓ol✓l✓l✓l-✓-✓-✓-
  2119.                  l✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n.   Return true if each element of the
  2120.                  receiver   collection   is   equal   to   the
  2121.                  corresponding  element in the argument offset
  2122.                  by the amount given in the second argument.
  2123.  
  2124.     findFirst:   Find the key  for  the  first  element  whose
  2125.                  value  satisfies the argument block.  Produce
  2126.                  an error message if no such element exists.
  2127.  
  2128.     findFirst:ifAbsent:
  2129.                  Both arguments must be blocks.  Find the  key
  2130.                  for  the  first element whose value satisfies
  2131.                  the first argument block.  If no such element
  2132.                  exists  return  the value of the second argu-
  2133.                  ment.
  2134.  
  2135.     findLast:    Find the key for the last element whose value
  2136.                  satisfies  the  argument  block.   Produce an
  2137.                  error message if no such element exists.
  2138.  
  2139.     findLast:ifAbsent:
  2140.                  Both arguments must be blocks.  Find the  key
  2141.                  for  the  last  element whose value satisfies
  2142.                  the first argument block.  If no such element
  2143.                  exists   return   the  value  of  the  second
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.   class S✓S✓S✓Se✓e✓e✓eq✓q✓q✓qu✓u✓u✓ue✓e✓e✓en✓n✓n✓nc✓c✓c✓ce✓e✓e✓ea✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓eC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n (continued)
  2154.  
  2155.  
  2156.                  argument block.
  2157.  
  2158.     firstKey     Return the first key valid for  the  receiver
  2159.                  collection.
  2160.  
  2161.     indexOfSubCollection:startingAt:
  2162.                  Starting at the position given by the  second
  2163.                  argument,  find the next block of elements in
  2164.                  the receiver collection which match the  col-
  2165.                  lection  given  by  the  first  argument, and
  2166.                  return the index for the start of that block.
  2167.                  Produce  an error message if no such position
  2168.                  exists.
  2169.  
  2170.     indexOfSubCollection:startingAt:ifAbsent:
  2171.                  Similar to  _✓i_✓n_✓d_✓e_✓x_✓O_✓f_✓S_✓u_✓b_✓C_✓o_✓l_✓l_✓e_✓c_✓t_✓i_✓o_✓n:_✓s_✓t_✓a_✓r_✓t_✓i_✓n_✓g_✓A_✓t:,
  2172.                  except that the result of the exception block
  2173.                  is produced if no  position  exists  matching
  2174.                  the pattern.
  2175.  
  2176.     last         Return the last element in the receiver  col-
  2177.                  lection.
  2178.  
  2179.     lastKey      Return the last key valid  for  the  receiver
  2180.                  collection.
  2181.  
  2182.     replaceFrom:to:with:
  2183.                  Replace the elements in the receiver  collec-
  2184.                  tion  in the positions indicated by the first
  2185.                  two arguments with values taken from the col-
  2186.                  lection given by the third argument.
  2187.  
  2188.     replaceFrom:to:with:startingAt:
  2189.                  Replace the elements in the receiver  collec-
  2190.                  tion  in the positions indicated by the first
  2191.                  two arguments with values taken from the col-
  2192.                  lection given in the third argument, starting
  2193.                  at the position given by the fourth argument.
  2194.  
  2195.   _✓n reversed     Return a collection, like the receiver,  with
  2196.                  elements reversed.
  2197.  
  2198.     reverseDo:   Similar to _✓d_✓o:, except  that  the  items  are
  2199.                  presented in reverse order.
  2200.  
  2201.   _✓n sort         Return a collection, like the receiver,  with
  2202.                  the  elements sorted using the comparison <=.
  2203.                  Elements must  be  able  to  respond  to  the
  2204.                  binary message <=.
  2205.  
  2206.   _✓n sort:        The argument must be  a  two  argument  block
  2207.                  which yields a boolean.  Return a collection,
  2208.                  like the receiver, sorted using the  argument
  2209.                  to   compare  elements  for  the  purpose  of
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.   class S✓S✓S✓Se✓e✓e✓eq✓q✓q✓qu✓u✓u✓ue✓e✓e✓en✓n✓n✓nc✓c✓c✓ce✓e✓e✓ea✓a✓a✓ab✓b✓b✓bl✓l✓l✓le✓e✓e✓eC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n (continued)
  2220.  
  2221.  
  2222.                  ordering.
  2223.  
  2224.     with:do:     The second argument must be  a  two  argument
  2225.                  block.  Present one element from the receiver
  2226.                  collection and from the collection  given  by
  2227.                  the  first  argument  in  turn  to the second
  2228.                  argument block.  An error message is given if
  2229.                  the  collections  do not have the same number
  2230.                  of elements.
  2231.  
  2232.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2233.  
  2234.                                           Printed result
  2235.  
  2236.   i <- 'abacadabra'
  2237.   i copyFrom: 4 to: 8                     cadab
  2238.   i copyWith: $z                          abacadabraz
  2239.   i copyWithout: $a                       bcdbr
  2240.   i findFirst: [:x | x > $m]              9
  2241.   i indexOfSubCollection: 'dab' startingAt: 16
  2242.   i reversed                              arbadacaba
  2243.   i , i reversed                          abacadabraarbadacaba
  2244.   i sort: [:x :y | x >= y]                rdcbbaaaaa
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.   Object
  2289.     Collection
  2290.       KeyedCollection
  2291.         SequenceableCollection
  2292.           I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rv✓v✓v✓va✓a✓a✓al✓l✓l✓l
  2293.  
  2294.        The class I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rv✓v✓v✓va✓a✓a✓al✓l✓l✓l represents a sequence of numbers  in
  2295.   an  arithmetic  sequence,  either  ascending  or descending.
  2296.   Instances of I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rv✓v✓v✓va✓a✓a✓al✓l✓l✓l are created by numbers in response  to
  2297.   the  message _✓t_✓o: or _✓t_✓o:_✓b_✓y:.  In conjunction with the message
  2298.   _✓d_✓o:, I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rv✓v✓v✓va✓a✓a✓al✓l✓l✓ls✓s✓s✓s create a control structure similar to  do  or
  2299.   for loops in Algol like languages.  For example:
  2300.  
  2301.  
  2302.                  (1 to: 10) do: [:x | x print]
  2303.  
  2304.  
  2305.   will print the numbers 1 through 10.  Although  they  are  a
  2306.   collection,  I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rv✓v✓v✓va✓a✓a✓al✓l✓l✓ls✓s✓s✓s  cannot  be added to.  They can, how-
  2307.   ever, be accessed randomly using the message _✓a_✓t:.
  2308.  
  2309.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2310.  
  2311.     first        Produce the first element from the  interval.
  2312.                  In conjunction with _✓l_✓a_✓s_✓t, this message may be
  2313.                  used to produce each element from the  inter-
  2314.                  val   in  turn.   Note  that  I✓I✓I✓In✓n✓n✓nt✓t✓t✓te✓e✓e✓er✓r✓r✓rv✓v✓v✓va✓a✓a✓al✓l✓l✓ls✓s✓s✓s  also
  2315.                  respond to the message _✓a_✓t:, which can be used
  2316.                  to produce elements in an arbitrary order.
  2317.  
  2318.     from:to:by:  Initialize the upper and lower bounds and the
  2319.                  step  size  for  the receiver.  (This is used
  2320.                  principally  internally  by  the  method  for
  2321.                  number to create new Intervals).
  2322.  
  2323.     next         Produce the next element from the interval.
  2324.  
  2325.     size         Return the number of elements  that  will  be
  2326.                  generated in producing the interval.
  2327.  
  2328.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2329.  
  2330.                                           Printed result
  2331.  
  2332.   (7 to: 13 by: 3) asArray                #( 7 10 13 )
  2333.   (7 to: 13 by: 3) at: 2                  10
  2334.   (1 to: 10) inject: 0 into: [:x :y | x + y]55
  2335.   (7 to: 13) copyFrom: 2 to: 5            #( 8 9 10 11 )
  2336.   (3 to: 5) copyWith: 13                  #( 3 4 5 13 )
  2337.   (3 to: 5) copyWithout: 4                #( 3 5 )
  2338.   (2 to: 4) equals: (1 to: 4) startingAt: 2True
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.   Object
  2355.     Collection
  2356.       KeyedCollection
  2357.         SequenceableCollection
  2358.           L✓L✓L✓Li✓i✓i✓is✓s✓s✓st✓t✓t✓t
  2359.  
  2360.        Lists represent collections with  a  fixed  order,  but
  2361.   indefinite  size.   No keys are used, and elements are added
  2362.   or removed from one end of the other.   Used  in  this  way,
  2363.   Lists  can  perform as _✓s_✓t_✓a_✓c_✓k_✓s or as _✓q_✓u_✓e_✓u_✓e_✓s.  The table below
  2364.   illustrates how stack and queue  operations  can  be  imple-
  2365.   mented in terms of messages to instances of List.
  2366.  
  2367.   _✓s_✓t_✓a_✓c_✓k _✓o_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n_✓s          _✓q_✓u_✓e_✓u_✓e _✓o_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n_✓s
  2368.  
  2369.   _____________________________________________________________
  2370.   push         addLast:     add                     addLast:
  2371.   pop          removeLast   first in queue          first
  2372.   top          last         remove first in queue   removeFirst
  2373.   test empty   isEmpty      test empty              isEmpty
  2374.                           |✓|✓|✓|✓|✓|✓|
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2382.  
  2383.     add:         Add the  element  to  the  beginning  of  the
  2384.                  receiver  collection.   This  is  the same as
  2385.                  _✓a_✓d_✓d_✓F_✓i_✓r_✓s_✓t:.
  2386.  
  2387.     addAllFirst: The argument must  be  a  SequenceableCollec-
  2388.                  tion.   The  elements  of  the  argument  are
  2389.                  added, in order, to the front of the receiver
  2390.                  collection.
  2391.  
  2392.     addAllLast:  The argument must  be  a  SequenceableCollec-
  2393.                  tion.   The  elements  of  the  argument  are
  2394.                  added, in order, to the end of  the  receiver
  2395.                  collection.
  2396.  
  2397.     addFirst:    The argument is added to  the  front  of  the
  2398.                  receiver collection.
  2399.  
  2400.     addLast:     The argument is added  to  the  back  of  the
  2401.                  receiver collection.
  2402.  
  2403.     removeFirst  Remove the first element  from  the  receiver
  2404.                  collection, returning the removed value.
  2405.  
  2406.     removeLast   Remove the last  element  from  the  receiver
  2407.                  collection, returning the removed value.
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.   class L✓L✓L✓Li✓i✓i✓is✓s✓s✓st✓t✓t✓t (continued)
  2422.  
  2423.  
  2424.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2425.  
  2426.                                           Printed result
  2427.  
  2428.   i <- List new
  2429.   i addFirst: 2 / 3                       List ( 0.6666 )
  2430.   i add: $A
  2431.   i addAllLast: (12 to: 14 by: 2)
  2432.   i print                                 List ( 0.6666 $A 12 14 )
  2433.   i first                                 0.6666
  2434.   i removeLast                            14
  2435.   i print                                 List ( 0.6666 $A 12 )
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.   Object
  2491.     Collection
  2492.       KeyedCollection
  2493.         SequenceableCollection
  2494.           List
  2495.             S✓S✓S✓Se✓e✓e✓em✓m✓m✓ma✓a✓a✓ap✓p✓p✓ph✓h✓h✓ho✓o✓o✓or✓r✓r✓re✓e✓e✓e
  2496.  
  2497.        Semaphores are used to synchronize concurrently running
  2498.   P✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓se✓e✓e✓es✓s✓s✓s.
  2499.  
  2500.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  2501.  
  2502.     new:         If created using _✓n_✓e_✓w, a S✓S✓S✓Se✓e✓e✓em✓m✓m✓ma✓a✓a✓ap✓p✓p✓ph✓h✓h✓ho✓o✓o✓or✓r✓r✓re✓e✓e✓e starts  out
  2503.                  with  zero  excess signals.  Alternatively, a
  2504.                  S✓S✓S✓Se✓e✓e✓em✓m✓m✓ma✓a✓a✓ap✓p✓p✓ph✓h✓h✓ho✓o✓o✓or✓r✓r✓re✓e✓e✓e can be created  with  an  arbitrary
  2505.                  number  of  excess  signals  by  giving it an
  2506.                  argument to _✓n_✓e_✓w:.
  2507.  
  2508.     signal       If there is a process blocked  on  the  sema-
  2509.                  phore  is  it scheduled for execution, other-
  2510.                  wise the number of excess signals  is  incre-
  2511.                  mented by one.
  2512.  
  2513.     wait         If there are excess signals  associated  with
  2514.                  the semaphore the number of signals is decre-
  2515.                  mented by one, otherwise the current  process
  2516.                  is placed on the semaphore queue.
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.   Object
  2557.     Collection
  2558.       KeyedCollection
  2559.         SequenceableCollection
  2560.           F✓F✓F✓Fi✓i✓i✓il✓l✓l✓le✓e✓e✓e
  2561.  
  2562.        A F✓F✓F✓Fi✓i✓i✓il✓l✓l✓le✓e✓e✓e is a type of collection where  the  elements  of
  2563.   the collection are stored on an external medium, typically a
  2564.   disk.  For this reason, although most operations on  collec-
  2565.   tions  are defined for files, many can be quite slow in exe-
  2566.   cution.  A file can be opened on  one  of  three  _✓m_✓o_✓d_✓e_✓s:  In
  2567.   _✓c_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r  mode  every  read returns a single character from
  2568.   the file.  In _✓i_✓n_✓t_✓e_✓g_✓e_✓r mode every read returns a single word,
  2569.   as  an  integer  value.  In _✓s_✓t_✓r_✓i_✓n_✓g mode every read returns a
  2570.   single line, as a S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g.  For writing, character and string
  2571.   modes  will write the string representation of the argument,
  2572.   while integer mode must write only a single integer.
  2573.  
  2574.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  2575.  
  2576.     at:          Return the object  stored  at  the  indicated
  2577.                  position.   Position  is given as a character
  2578.                  count from the start of the file.
  2579.  
  2580.     at:put:      Place the object at the indicated position in
  2581.                  the  file.   Position is given as a character
  2582.                  count from the start of the file.
  2583.  
  2584.     characterModeSet the mode of the receiver file to  _✓c_✓h_✓a_✓r_✓a_✓c_✓-
  2585.                  _✓t_✓e_✓r.
  2586.  
  2587.     currentKey   Return the current position in the file, as a
  2588.                  character count from the start of the file.
  2589.  
  2590.     integerMode  Set the mode of the receiver file to _✓i_✓n_✓t_✓e_✓g_✓e_✓r.
  2591.  
  2592.     open:        Open the indicated  file  for  reading.   The
  2593.                  argument must be a S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g.
  2594.  
  2595.     open:for:    The _✓f_✓o_✓r: argument must be one of 'r', 'w'  or
  2596.                  'r+'  (see  fopen(3)  in the Unix programmers
  2597.                  manual).  Open  the  file  in  the  indicated
  2598.                  mode.
  2599.  
  2600.     read         Return the next object from the file.
  2601.  
  2602.     size         Return the size of  the  file,  in  character
  2603.                  counts.
  2604.  
  2605.     stringMode   Set the mode of the receiver file to _✓s_✓t_✓r_✓i_✓n_✓g.
  2606.  
  2607.     write:       Write the argument into the file.
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.   Object
  2623.     Collection
  2624.       KeyedCollection
  2625.         SequenceableCollection
  2626.           A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ye✓e✓e✓ed✓d✓d✓dC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n
  2627.  
  2628.        The class A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ye✓e✓e✓ed✓d✓d✓dC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n provides protocol for  col-
  2629.   lections  with  a Fixed size and integer keys.  Unlike other
  2630.   collections,  which  are  created  using  the  message  _✓n_✓e_✓w,
  2631.   instances of A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ye✓e✓e✓ed✓d✓d✓dC✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n must be created using the one
  2632.   argument message _✓n_✓e_✓w:.  The argument given with this message
  2633.   must  be  a  positive  integer, representing the size of the
  2634.   collection to be  created.   In  addition  to  the  protocol
  2635.   shown,  many  of the methods inherited from superclasses are
  2636.   redefined in this class.
  2637.  
  2638.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2639.  
  2640.     =            The argument must also  be  an  A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y.   Test
  2641.                  whether  the  receiver  and the argument have
  2642.                  equal elements listed in the same order.
  2643.  
  2644.     at:ifAbsent: Return the element stored with the given key.
  2645.                  Return  the  result  of evaluating the second
  2646.                  argument if the key  is  not  valid  for  the
  2647.                  receiver collection.
  2648.  
  2649.   _✓n padTo:       Return an array like the received that is  at
  2650.                  least as long as the argument value.  Returns
  2651.                  the receiver if it is already longer than the
  2652.                  argument.
  2653.  
  2654.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2655.  
  2656.                                           Printed result
  2657.  
  2658.   'small' = 'small'                       True
  2659.   'small' = 'SMALL'                       False
  2660.   'small' asArray                         #( $s $m $a $l $l)
  2661.   'small' asArray = 'small'               True
  2662.   #(1 2 3) padTo: 5                       #(1 2 3 nil nil)
  2663.   #(1 2 3) padTo: 2                       #(1 2 3)
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.   Object
  2689.     Collection
  2690.       KeyedCollection
  2691.         SequenceableCollection
  2692.           ArrayedCollection
  2693.             A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y
  2694.  
  2695.        Instances of the class A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y are perhaps the most  com-
  2696.   monly used data structure in Smalltalk programs.  A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ys✓s✓s✓s are
  2697.   represented textually by a pound sign preceding the list  of
  2698.   array elements.
  2699.  
  2700.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2701.  
  2702.     at:          Return the item stored in the position  given
  2703.                  by  the  argument.   An error message is pro-
  2704.                  duced, and n✓n✓n✓ni✓i✓i✓il✓l✓l✓l returned, if the  argument  is
  2705.                  not a valid key.
  2706.  
  2707.     at:put:      Store the second  argument  in  the  position
  2708.                  given  by  the first argument.  An error mes-
  2709.                  sage is produced, and n✓n✓n✓ni✓i✓i✓il✓l✓l✓l  returned,  if  the
  2710.                  argument is not a valid key.
  2711.  
  2712.     grow:        Return a new array one  element  larger  than
  2713.                  the   receiver,   with   the  argument  value
  2714.                  attached to the end.  This is a slightly more
  2715.                  efficient  command  than  _✓c_✓o_✓p_✓y_✓W_✓i_✓t_✓h:, although
  2716.                  the effect is the same.
  2717.  
  2718.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2719.  
  2720.                                           Printed result
  2721.  
  2722.   i <- #(110 101 97)
  2723.   i size                                  3
  2724.   i <- i grow: 116                        #( 110 101 97 116)
  2725.   i <- i collect: [:x | x asCharacter]    #( #n #e #a #t )
  2726.   i asString                              neat
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.   Object
  2755.     Collection
  2756.       KeyedCollection
  2757.         SequenceableCollection
  2758.           ArrayedCollection
  2759.             B✓B✓B✓By✓y✓y✓yt✓t✓t✓te✓e✓e✓eA✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y
  2760.  
  2761.        A B✓B✓B✓By✓y✓y✓yt✓t✓t✓te✓e✓e✓eA✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y is a special form of  array  in  which  the
  2762.   elements  must  be numbers in the range 0-255.  Instances of
  2763.   B✓B✓B✓By✓y✓y✓yt✓t✓t✓te✓e✓e✓eA✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y are given a very compact encoding,  and  are  used
  2764.   extensively  internally  in  the Little Smalltalk system.  A
  2765.   B✓B✓B✓By✓y✓y✓yt✓t✓t✓te✓e✓e✓eA✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y can be  represented  textually  by  a  pound  sign
  2766.   preceding the list of array elements surrounded by a pair of
  2767.   square braces.
  2768.  
  2769.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2770.  
  2771.     at:          Return the item stored in the position  given
  2772.                  by  the  argument.   An error message is pro-
  2773.                  duced, and n✓n✓n✓ni✓i✓i✓il✓l✓l✓l returned, if the  argument  is
  2774.                  not a valid key.
  2775.  
  2776.     at:put:      Store the second  argument  in  the  position
  2777.                  given  by  the first argument.  An error mes-
  2778.                  sage is produced, and n✓n✓n✓ni✓i✓i✓il✓l✓l✓l  returned,  if  the
  2779.                  argument is not a valid key.
  2780.  
  2781.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2782.  
  2783.                                           Printed result
  2784.  
  2785.   i <- #[110 101 97]
  2786.   i size                                  3
  2787.   i <- i copyWith: 116                    #[ 110 101 97 116 ]
  2788.   i <- i asArray collect: [:x | x asCharacter]#( #n #e #a #t )
  2789.   i asString                              neat
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.   Object
  2821.     Collection
  2822.       KeyedCollection
  2823.         SequenceableCollection
  2824.           ArrayedCollection
  2825.             S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g
  2826.  
  2827.        Instances of the class S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g are  similar  to  A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ys✓s✓s✓s,
  2828.   except  that  the  individual  elements  must  be C✓C✓C✓Ch✓h✓h✓ha✓a✓a✓ar✓r✓r✓ra✓a✓a✓ac✓c✓c✓ct✓t✓t✓te✓e✓e✓er✓r✓r✓r.
  2829.   S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓gs✓s✓s✓s are represented literally by  placing  single  quote
  2830.   marks  around  the characters making up the string.  S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓gs✓s✓s✓s
  2831.   also differ from A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓ys✓s✓s✓s in that Strings possess an ordering,
  2832.   given by the underlying ascii sequence.
  2833.  
  2834.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2835.  
  2836.     ,            Concatenates the  argument  to  the  receiver
  2837.                  string, producing a new string.  If the argu-
  2838.                  ment is not a S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g it  is  first  converted
  2839.                  using _✓p_✓r_✓i_✓n_✓t_✓S_✓t_✓r_✓i_✓n_✓g.
  2840.  
  2841.     <            The argument must be a S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g.  Test  if  the
  2842.                  receiver is lexically less than the argument.
  2843.                  For the purposes of comparison  case  differ-
  2844.                  ences are ignored.
  2845.  
  2846.     <=           Test if the receiver is lexically  less  than
  2847.                  or equal to the argument.
  2848.  
  2849.     >=           Test if the  receiver  is  lexically  greater
  2850.                  than or equal to the argument.
  2851.  
  2852.     >            Test if the  receiver  is  lexically  greater
  2853.                  than the argument.
  2854.  
  2855.   _✓r asSymbol     Return a S✓S✓S✓Sy✓y✓y✓ym✓m✓m✓mb✓b✓b✓bo✓o✓o✓ol✓l✓l✓l with characters given by  the
  2856.                  receiver string.
  2857.  
  2858.     at:          Return the character stored at  the  position
  2859.                  given by the argument. Produce and error mes-
  2860.                  sage, and return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l, if  the  argument  does
  2861.                  not represent a valid key.
  2862.  
  2863.     at:put:      Store the character given by second  argument
  2864.                  at  the location given by the first argument.
  2865.                  Produce an error message, and return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l,  if
  2866.                  either argument is invalid.
  2867.  
  2868.   _✓n copyFrom:length:
  2869.                  Return a substring of the receiver.  The sub-
  2870.                  string  is  taken from the indicated starting
  2871.                  position in the receiver and extends for  the
  2872.                  given  length.  Produce an error message, and
  2873.                  return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l, if the given  positions  are  not
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.   class S✓S✓S✓St✓t✓t✓tr✓r✓r✓ri✓i✓i✓in✓n✓n✓ng✓g✓g✓g (continued)
  2884.  
  2885.  
  2886.                  legal.
  2887.  
  2888.   _✓r copyFrom:to: Return a substring of the receiver.  The sub-
  2889.                  string is taken from the indicated positions.
  2890.                  Produce an error message, and return n✓n✓n✓ni✓i✓i✓il✓l✓l✓l,  if
  2891.                  the given positions are not legal.
  2892.  
  2893.   _✓n printAt:     The argument must be a P✓P✓P✓Po✓o✓o✓oi✓i✓i✓in✓n✓n✓nt✓t✓t✓t which  describes
  2894.                  a  location  on  the  terminal  screen.   The
  2895.                  string is printed at the specified location.
  2896.  
  2897.     size         Return the number of characters stored in the
  2898.                  string.
  2899.  
  2900.     sameAs:      Return true  if  the  receiver  and  argument
  2901.                  string  match  with  the  exception  of  case
  2902.                  differences.  Note that the boolean message =
  2903.                  ,  inherited  from  ArrayedCollection, can be
  2904.                  used to see  if  two  strings  are  the  same
  2905.                  including case differences.
  2906.  
  2907.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  2908.  
  2909.                                           Printed result
  2910.  
  2911.   'example' at: 2                         $x
  2912.   'bead' at: 1 put: $r                    read
  2913.   'small' > 'BIG'                         True
  2914.   'small' sameAs: 'SMALL'                 True
  2915.   'tary' sort                             arty
  2916.   'Rats live on no evil Star' reversed    ratS live on no evil staR
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.   Object
  2953.     B✓B✓B✓Bl✓l✓l✓lo✓o✓o✓oc✓c✓c✓ck✓k✓k✓k
  2954.  
  2955.        Although it is easy for  the  programmer  to  think  of
  2956.   blocks  as  a  syntactic  construct, or a control structure,
  2957.   they are actually objects, and share attributes of all other
  2958.   objects  in  the  Smalltalk  system,  such as the ability to
  2959.   respond to messages.
  2960.  
  2961.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  2962.  
  2963.     fork         Start the block executing as a P✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s.   The
  2964.                  value  n✓n✓n✓ni✓i✓i✓il✓l✓l✓l  is  immediately returned, and the
  2965.                  P✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s created from the block  is  scheduled
  2966.                  to run in parallel with the current process.
  2967.  
  2968.     forkWith:    Similar to _✓f_✓o_✓r_✓k, except  that  the  array  is
  2969.                  passed  as  arguments  to  the receiver block
  2970.                  prior to scheduling for execution.
  2971.  
  2972.     newProcess   A new P✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s is created for the  block,  but
  2973.                  is not scheduled for execution.
  2974.  
  2975.   _✓n newProcessWith:
  2976.                  Similar to _✓n_✓e_✓w_✓P_✓r_✓o_✓c_✓e_✓s_✓s, except that the  array
  2977.                  is  passed as arguments to the receiver block
  2978.                  prior to it being made into a process.
  2979.  
  2980.     value        Evaluates the receiver  block.   Produces  an
  2981.                  error   message,  and  returns  nil,  if  the
  2982.                  receiver block  required  arguments.   Return
  2983.                  the value yielded by the block.
  2984.  
  2985.     value:       Evaluates the receiver  block.   Produces  an
  2986.                  error   message,  and  returns  nil,  if  the
  2987.                  receiver block did not require a single argu-
  2988.                  ment.  Return the value yielded by the block.
  2989.  
  2990.     value:value: Two argument block evaluation.
  2991.  
  2992.     value:value:value:
  2993.                  Three argument block evaluation.
  2994.  
  2995.     value:value:value:value:
  2996.                  Four argument block evaluation.
  2997.  
  2998.     value:value:value:value:value:
  2999.                  Five argument block evaluation.
  3000.  
  3001.     whileTrue:   The receiver block is  repeatedly  evaluated.
  3002.                  While  it  evaluates  to  true,  the argument
  3003.                  block is also evaluated.  Return nil when the
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.   class B✓B✓B✓Bl✓l✓l✓lo✓o✓o✓oc✓c✓c✓ck✓k✓k✓k (continued)
  3016.  
  3017.  
  3018.                  receiver block no longer evaluates to true.
  3019.  
  3020.     whileTrue    The receiver block  is  repeatedly  evaluated
  3021.                  until it returns a value that is not true.
  3022.  
  3023.     whileFalse:  The receiver block is  repeatedly  evaluated.
  3024.                  While  it  evaluates  to  false, the argument
  3025.                  block is also evaluated.  Return nil when the
  3026.                  receiver block no longer evaluates to false.
  3027.  
  3028.     whileFalse   The receiver block  is  repeatedly  evaluated
  3029.                  until it returns a value that is not false.
  3030.  
  3031.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  3032.  
  3033.                                           Printed result
  3034.  
  3035.   ['block indeed'] value                  block indeed
  3036.   [:x :y | x + y + 3] value: 5 value: 7   15
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.   Object
  3085.     C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s
  3086.  
  3087.        The class  C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s  provides  protocol  for  manipulating
  3088.   class  instances.   An  instance of class C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s is generated
  3089.   for each class in the Smalltalk system.   New  instances  of
  3090.   this  class are then formed by sending messages to the class
  3091.   instance.
  3092.  
  3093.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓t_✓o
  3094.  
  3095.   _✓n deepCopy:    The argument  must  be  an  instance  of  the
  3096.                  receiver  class.   A deepCopy of the argument
  3097.                  is returned.
  3098.  
  3099.   _✓n edit         The user is placed into a editor editing  the
  3100.                  file  from  which  the  class description was
  3101.                  originally obtained.  When  the  editor  ter-
  3102.                  minates,   the   class  description  will  be
  3103.                  reparsed  and  will  override  the   previous
  3104.                  description.  See also _✓v_✓i_✓e_✓w (below).
  3105.  
  3106.   _✓n list         Lists  all  subclasses  of  the  given  class
  3107.                  recursively.  In particular, O✓O✓O✓Ob✓b✓b✓bj✓j✓j✓je✓e✓e✓ec✓c✓c✓ct✓t✓t✓t _✓l_✓i_✓s_✓t will
  3108.                  list the names of all the classes in the sys-
  3109.                  tem.
  3110.  
  3111.     new          A new  instance  of  the  receiver  class  is
  3112.                  returned.   If  the  methods for the receiver
  3113.                  contain protocol for _✓n_✓e_✓w,  the  new  instance
  3114.                  will first be passed this message.
  3115.  
  3116.     new:         A new  instance  of  the  receiver  class  is
  3117.                  returned.   If  the  methods for the receiver
  3118.                  contain protocol for _✓n_✓e_✓w:, the  new  instance
  3119.                  will first be passed this message.
  3120.  
  3121.   _✓n respondsTo   List all the messages that the current  class
  3122.                  will respond to.
  3123.  
  3124.   _✓d respondsTo:  The argument must be a Symbol.   Return  true
  3125.                  if  the receiver class, or any of its superc-
  3126.                  lasses, contains a method for  the  indicated
  3127.                  message. Return false otherwise.
  3128.  
  3129.   _✓n shallowCopy: The argument  must  be  an  instance  of  the
  3130.                  receiver  class.   A shallowCopy of the argu-
  3131.                  ment is returned.
  3132.  
  3133.   _✓n superClass   Return the superclass of the receiver class.
  3134.  
  3135.   _✓n variables    Return an array containing the names  of  the
  3136.                  instance   variables  used  in  the  receiver
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.   class C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s (continued)
  3148.  
  3149.  
  3150.                  class.
  3151.  
  3152.   _✓n view         Place the user into  an  editor  viewing  the
  3153.                  class  description  from  which the class was
  3154.                  created.  Changes made to the file will  not,
  3155.                  however, affect the current class representa-
  3156.                  tion.
  3157.  
  3158.   _✓E_✓x_✓a_✓m_✓p_✓l_✓e_✓s
  3159.  
  3160.                                           Printed result
  3161.  
  3162.   Array new: 3                            #( nil nil nil )
  3163.   Bag respondsTo: #add:                   True
  3164.   SequenceableCollection superClass       KeyedCollection
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.   Object
  3217.     P✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s
  3218.  
  3219.        Processes are created by the system, or by passing  the
  3220.   message  _✓n_✓e_✓w_✓P_✓r_✓o_✓c_✓e_✓s_✓s  or  _✓f_✓o_✓r_✓k  to  a  block;  they cannot be
  3221.   created directly by the user.
  3222.  
  3223.   _✓R_✓e_✓s_✓p_✓o_✓n_✓d_✓s _✓T_✓o
  3224.  
  3225.     block        The  receiver  process  is  marked  as  being
  3226.                  blocked.   This  is  usually  the result of a
  3227.                  semaphore wait.  Blocked  processes  are  not
  3228.                  executed.
  3229.  
  3230.     resume       If the receiver process has  been  _✓s_✓u_✓s_✓p_✓e_✓n_✓ded,
  3231.                  it is rescheduled for execution.
  3232.  
  3233.     suspend      If the receiver process is scheduled for exe-
  3234.                  cution, it is marked as suspended.  Suspended
  3235.                  processes are not executed.
  3236.  
  3237.     state        The current state of the receiver process  is
  3238.                  returned as a Symbol.
  3239.  
  3240.     terminate    The receiver process is terminated.  Unlike a
  3241.                  blocked  or  suspended  process, a terminated
  3242.                  process cannot be restarted.
  3243.  
  3244.     unblock      If the receiver process is currently blocked,
  3245.                  it is scheduled for execution.
  3246.  
  3247.     yield        Returns n✓n✓n✓ni✓i✓i✓il✓l✓l✓l.  As a side effect,  however,  if
  3248.                  there  are pending processes the current pro-
  3249.                  cess is placed back on the process queue  and
  3250.                  another process started.
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.